package com.ruoyi.web.controller.system;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.TudaOrder;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.ITuDaFinanceService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName TudaCompanyController
 * @Description TODO
 * @Author tuda
 * @Date 2023/8/16 10:32
 * @Version 1.0
 **/
@Controller
@RequestMapping("/system/company")
public class TudaCompanyController extends BaseController {

    private String prefix = "system/company/user";

    @Resource
    private ISysUserService userService;
    @Resource
    private ITuDaFinanceService financeService;

    @RequiresPermissions("system:company:view")
    @GetMapping()
    public String user()
    {
        return prefix + "/user";
    }

    @RequiresPermissions("system:company:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(SysUser user)
    {
        startPage();
        List<SysUser> list = userService.selectUserList(user);
        return getDataTable(list);
    }

    /**
     * 查询运单列表
     */
    @RequiresPermissions("system:company:list")
    @GetMapping("/detail/{phonenumber}")
    public String detail(@PathVariable("phonenumber") String phonenumber, ModelMap mmap)
    {
        TudaOrder order = new TudaOrder();
        order.setHeadPhone(phonenumber);
        mmap.put("phonenumber", phonenumber);
//        mmap.put("dictList", dictTypeService.selectDictTypeAll());
        return "system/company/order/order";
    }

}
